<rss version="2.0" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
    <channel>
        <title>DNN Modules for Non-Profit Food Banks</title> 
        <link>http://www.dnnfoodbank.com</link> 
        <description>RSS feeds for DNN Modules for Non-Profit Food Banks</description> 
        <ttl>60</ttl> <item>
    <comments>http://www.dnnfoodbank.com/More-/Support/ID/12/Reporting-by-Age-Group#Comments</comments> 
    <slash:comments>0</slash:comments> 
    <wfw:commentRss>http://www.dnnfoodbank.com/DesktopModules/DnnForge%20-%20NewsArticles/RssComments.aspx?TabID=89&amp;ModuleID=415&amp;ArticleID=12</wfw:commentRss> 
    <trackback:ping>http://www.dnnfoodbank.com/DesktopModules/DnnForge%20-%20NewsArticles/Tracking/Trackback.aspx?ArticleID=12&amp;PortalID=0&amp;TabID=89</trackback:ping> 
    <title>Reporting by Age Group</title> 
    <link>http://www.dnnfoodbank.com/More-/Support/ID/12/Reporting-by-Age-Group</link> 
    <description>Stored procedure added to report on a client family age demographics.
CREATE PROCEDURE [dbo].[GIBS_FBClients_AgeGroupReport]

	@ClientID int

AS 
BEGIN    

SET NOCOUNT ON;
		
    CREATE TABLE #Temp    
    ( DOB   Date  NULL );     
     INSERT INTO #Temp (DOB)

	SELECT  GIBS_FBClientsAFM.ClAddFamMemDOB  AS DOB                     
	FROM         GIBS_FBClients 
	INNER JOIN  GIBS_FBClientsAddFamMem AS GIBS_FBClientsAFM ON GIBS_FBClients.ClientID = GIBS_FBClientsAFM.ClientID
	WHERE     GIBS_FBClients.ClientID = @ClientID
		
	
UNION ALL

	SELECT GIBS_FBClients.ClientDOB AS DOB                                          
	FROM  GIBS_FBClients 
	WHERE     GIBS_FBClients.ClientID = @ClientID


-- SELECT THE REPORT FROM TEMP TABLE
	SELECT                              
	count( dbo.fn_GIBS_FBClients_GetAgeGroup(DOB,GetDate())) As AgeGroupCount 
	 , dbo.fn_GIBS_FBClients_GetAgeGroup(DOB,GetDate()) As AgeGroup                
	FROM         #Temp 
	GROUP BY dbo.fn_GIBS_FBClients_GetAgeGroup(DOB,GetDate())

 DROP TABLE #Temp


END
</description> 
    <dc:creator>Joseph Aucoin</dc:creator> 
    <pubDate>Thu, 05 Sep 2013 11:57:00 GMT</pubDate> 
    <guid isPermaLink="false">f1397696-738c-4295-afcd-943feb885714:12</guid> 
    
</item>

    </channel>
</rss>